<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>ESP8266 ILI9341 display support code with printf sources, wire-frame viewer and custom fonts: yield/cont_util.c Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">ESP8266 ILI9341 display support code with printf sources, wire-frame viewer and custom fonts
   &#160;<span id="projectnumber">1.0</span>
   </div>
   <div id="projectbrief">ESP8266ILI9341DisplayProject</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>Globals</span></a></li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_76a4952186d2aa80a822dd50f57a9a1c.html">yield</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">cont_util.c</div>  </div>
</div><!--header-->
<div class="contents">
<a href="cont__util_8c.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="comment">/*</span></div><div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="comment"> cont_util.s - continuations support for Xtensa call0 ABI</span></div><div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="comment"> Copyright (c) 2014 Ivan Grokhotkov. All rights reserved.</span></div><div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="comment"> This file is part of the esp8266 core for Arduino environment.</span></div><div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="comment"></span></div><div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="comment"> This library is free software; you can redistribute it and/or</span></div><div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="comment"> modify it under the terms of the GNU Lesser General Public</span></div><div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="comment"> License as published by the Free Software Foundation; either</span></div><div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="comment"> version 2.1 of the License, or (at your option) any later version.</span></div><div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="comment"></span></div><div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="comment"> This library is distributed in the hope that it will be useful,</span></div><div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="comment">but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div><div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="comment">MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU</span></div><div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="comment">Lesser General Public License for more details.</span></div><div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;<span class="comment"></span></div><div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;<span class="comment">You should have received a copy of the GNU Lesser General Public</span></div><div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;<span class="comment">License along with this library; if not, write to the Free Software</span></div><div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;<span class="comment">Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA</span></div><div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;<span class="comment">*/</span></div><div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;</div><div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="cont_8h.html">cont.h</a>&quot;</span></div><div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;<span class="preprocessor">#include &lt;stddef.h&gt;</span></div><div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="ets__sys_8h.html">ets_sys.h</a>&quot;</span></div><div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;</div><div class="line"><a name="l00025"></a><span class="lineno"><a class="line" href="cont__util_8c.html#a07e523b19238520e93d5bdba3fbc8942">   25</a></span>&#160;<span class="preprocessor">#define CONT_STACKGUARD 0xfeefeffe</span></div><div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;</div><div class="line"><a name="l00027"></a><span class="lineno"><a class="line" href="cont__util_8c.html#a1455643badb5923f8a46778c7a752584">   27</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="cont__util_8c.html#a1455643badb5923f8a46778c7a752584">cont_init</a>(<a class="code" href="structcont__.html">cont_t</a>* cont)</div><div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;{</div><div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;    cont-&gt;<a class="code" href="structcont__.html#a17c9f5d8bc954cc0381bdbe63d350048">stack_guard1</a> = <a class="code" href="cont__util_8c.html#a07e523b19238520e93d5bdba3fbc8942">CONT_STACKGUARD</a>;</div><div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;    cont-&gt;<a class="code" href="structcont__.html#af9e24c89ac69a95ae78a6c7f8a237da0">stack_guard2</a> = <a class="code" href="cont__util_8c.html#a07e523b19238520e93d5bdba3fbc8942">CONT_STACKGUARD</a>;</div><div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;    cont-&gt;<a class="code" href="structcont__.html#ab6e542a519497e515e2d3a62030a1f61">stack_end</a> = cont-&gt;<a class="code" href="structcont__.html#abc9f985ead0aa2c6795818c0bce6f9c1">stack</a> + (<span class="keyword">sizeof</span>(cont-&gt;<a class="code" href="structcont__.html#abc9f985ead0aa2c6795818c0bce6f9c1">stack</a>) / 4);</div><div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;    cont-&gt;<a class="code" href="structcont__.html#aa75475b47ca0d3a4a691651402c94fa3">struct_start</a> = (<span class="keywordtype">unsigned</span>*) cont;</div><div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;}</div><div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;</div><div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;</div><div class="line"><a name="l00036"></a><span class="lineno"><a class="line" href="cont__util_8c.html#a8795db353c660bc12f083742a906643c">   36</a></span>&#160;<span class="keywordtype">int</span> <a class="code" href="cont__util_8c.html#a8795db353c660bc12f083742a906643c">cont_check</a>(<a class="code" href="structcont__.html">cont_t</a>* cont)</div><div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;{</div><div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;    <span class="keywordflow">if</span>(cont-&gt;<a class="code" href="structcont__.html#a17c9f5d8bc954cc0381bdbe63d350048">stack_guard1</a> != <a class="code" href="cont__util_8c.html#a07e523b19238520e93d5bdba3fbc8942">CONT_STACKGUARD</a> || cont-&gt;<a class="code" href="structcont__.html#af9e24c89ac69a95ae78a6c7f8a237da0">stack_guard2</a> != <a class="code" href="cont__util_8c.html#a07e523b19238520e93d5bdba3fbc8942">CONT_STACKGUARD</a>) <span class="keywordflow">return</span> 1;</div><div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;</div><div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;    <span class="keywordflow">return</span> 0;</div><div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;}</div><div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;</div><div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;</div><div class="line"><a name="l00044"></a><span class="lineno"><a class="line" href="cont__util_8c.html#a7a8b25ee2153c3033f4590b39197661b">   44</a></span>&#160;<span class="keywordtype">bool</span> <a class="code" href="cont__util_8c.html#a7a8b25ee2153c3033f4590b39197661b">cont_can_yield</a>(<a class="code" href="structcont__.html">cont_t</a>* cont)</div><div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;{</div><div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;    <span class="keywordflow">return</span> !<a class="code" href="ets__sys_8h.html#a85d041e5bb0b1725560814da8be3a1b7">ETS_INTR_WITHINISR</a>() &amp;&amp;</div><div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;        cont-&gt;<a class="code" href="structcont__.html#a629ed7b6bf785c9027c7fc9eaac32f6e">pc_ret</a> != 0 &amp;&amp; cont-&gt;<a class="code" href="structcont__.html#af0d518438302b7f8629c06c85f5c41ae">pc_yield</a> == 0;</div><div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;}</div><div class="ttc" id="structcont___html_a629ed7b6bf785c9027c7fc9eaac32f6e"><div class="ttname"><a href="structcont__.html#a629ed7b6bf785c9027c7fc9eaac32f6e">cont_::pc_ret</a></div><div class="ttdeci">void(* pc_ret)(void)</div><div class="ttdef"><b>Definition:</b> <a href="cont_8h_source.html#l00032">cont.h:32</a></div></div>
<div class="ttc" id="ets__sys_8h_html_a85d041e5bb0b1725560814da8be3a1b7"><div class="ttname"><a href="ets__sys_8h.html#a85d041e5bb0b1725560814da8be3a1b7">ETS_INTR_WITHINISR</a></div><div class="ttdeci">bool ETS_INTR_WITHINISR()</div><div class="ttdef"><b>Definition:</b> <a href="ets__sys_8h_source.html#l00065">ets_sys.h:65</a></div></div>
<div class="ttc" id="structcont___html_abc9f985ead0aa2c6795818c0bce6f9c1"><div class="ttname"><a href="structcont__.html#abc9f985ead0aa2c6795818c0bce6f9c1">cont_::stack</a></div><div class="ttdeci">unsigned stack[CONT_STACKSIZE/4]</div><div class="ttdef"><b>Definition:</b> <a href="cont_8h_source.html#l00043">cont.h:43</a></div></div>
<div class="ttc" id="structcont___html_af9e24c89ac69a95ae78a6c7f8a237da0"><div class="ttname"><a href="structcont__.html#af9e24c89ac69a95ae78a6c7f8a237da0">cont_::stack_guard2</a></div><div class="ttdeci">unsigned stack_guard2</div><div class="ttdef"><b>Definition:</b> <a href="cont_8h_source.html#l00045">cont.h:45</a></div></div>
<div class="ttc" id="cont__util_8c_html_a8795db353c660bc12f083742a906643c"><div class="ttname"><a href="cont__util_8c.html#a8795db353c660bc12f083742a906643c">cont_check</a></div><div class="ttdeci">int cont_check(cont_t *cont)</div><div class="ttdef"><b>Definition:</b> <a href="cont__util_8c_source.html#l00036">cont_util.c:36</a></div></div>
<div class="ttc" id="cont__util_8c_html_a1455643badb5923f8a46778c7a752584"><div class="ttname"><a href="cont__util_8c.html#a1455643badb5923f8a46778c7a752584">cont_init</a></div><div class="ttdeci">void cont_init(cont_t *cont)</div><div class="ttdef"><b>Definition:</b> <a href="cont__util_8c_source.html#l00027">cont_util.c:27</a></div></div>
<div class="ttc" id="cont_8h_html"><div class="ttname"><a href="cont_8h.html">cont.h</a></div></div>
<div class="ttc" id="ets__sys_8h_html"><div class="ttname"><a href="ets__sys_8h.html">ets_sys.h</a></div></div>
<div class="ttc" id="structcont___html_af0d518438302b7f8629c06c85f5c41ae"><div class="ttname"><a href="structcont__.html#af0d518438302b7f8629c06c85f5c41ae">cont_::pc_yield</a></div><div class="ttdeci">void(* pc_yield)(void)</div><div class="ttdef"><b>Definition:</b> <a href="cont_8h_source.html#l00035">cont.h:35</a></div></div>
<div class="ttc" id="cont__util_8c_html_a07e523b19238520e93d5bdba3fbc8942"><div class="ttname"><a href="cont__util_8c.html#a07e523b19238520e93d5bdba3fbc8942">CONT_STACKGUARD</a></div><div class="ttdeci">#define CONT_STACKGUARD</div><div class="ttdef"><b>Definition:</b> <a href="cont__util_8c_source.html#l00025">cont_util.c:25</a></div></div>
<div class="ttc" id="cont__util_8c_html_a7a8b25ee2153c3033f4590b39197661b"><div class="ttname"><a href="cont__util_8c.html#a7a8b25ee2153c3033f4590b39197661b">cont_can_yield</a></div><div class="ttdeci">bool cont_can_yield(cont_t *cont)</div><div class="ttdef"><b>Definition:</b> <a href="cont__util_8c_source.html#l00044">cont_util.c:44</a></div></div>
<div class="ttc" id="structcont___html"><div class="ttname"><a href="structcont__.html">cont_</a></div><div class="ttdef"><b>Definition:</b> <a href="cont_8h_source.html#l00030">cont.h:30</a></div></div>
<div class="ttc" id="structcont___html_a17c9f5d8bc954cc0381bdbe63d350048"><div class="ttname"><a href="structcont__.html#a17c9f5d8bc954cc0381bdbe63d350048">cont_::stack_guard1</a></div><div class="ttdeci">unsigned stack_guard1</div><div class="ttdef"><b>Definition:</b> <a href="cont_8h_source.html#l00041">cont.h:41</a></div></div>
<div class="ttc" id="structcont___html_ab6e542a519497e515e2d3a62030a1f61"><div class="ttname"><a href="structcont__.html#ab6e542a519497e515e2d3a62030a1f61">cont_::stack_end</a></div><div class="ttdeci">unsigned * stack_end</div><div class="ttdef"><b>Definition:</b> <a href="cont_8h_source.html#l00038">cont.h:38</a></div></div>
<div class="ttc" id="structcont___html_aa75475b47ca0d3a4a691651402c94fa3"><div class="ttname"><a href="structcont__.html#aa75475b47ca0d3a4a691651402c94fa3">cont_::struct_start</a></div><div class="ttdeci">unsigned * struct_start</div><div class="ttdef"><b>Definition:</b> <a href="cont_8h_source.html#l00046">cont.h:46</a></div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Wed Jan 31 2018 21:22:16 for ESP8266 ILI9341 display support code with printf sources, wire-frame viewer and custom fonts by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.11
</small></address>
</body>
</html>
